package com.kgc.student.studentmanagerservice.service;

import com.kgc.student.bean.Classes;
import com.kgc.student.bean.Student;
import com.kgc.student.service.StuService;
import com.kgc.student.studentmanagerservice.mapper.ClassesMapper;
import com.kgc.student.studentmanagerservice.mapper.StudentMapper;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StuServiceImpl implements StuService {
    @Resource
    StudentMapper studentMapper;
    @Resource
    ClassesMapper classesMapper;
    @Override
    public List<Student> getAll() {
        return studentMapper.selectByExample(null);
    }

    @Override
    public List<Classes> getAllClasse() {
        return classesMapper.selectByExample(null);
    }

    @Override
    public int addStu(Student student) {
        return studentMapper.insert(student);
    }
}
